function xss_ajax(url) {
    var script_id = null;
    var script = document.createElement('script');
    script.setAttribute('type', 'text/javascript');
    script.setAttribute('src', url);
    script.setAttribute('id', 'script_id');

    script_id = document.getElementById('script_id');
    if(script_id){
        document.getElementsByTagName('head')[0].removeChild(script_id);
    }

    // Insert <script> into DOM
    document.getElementsByTagName('head')[0].appendChild(script);
}

function callback(data) {
	var objDiv;	
	objDiv=document.getElementById('SourceListPR');
	objDiv.innerHTML=data['result'];
}

var myURL=null;
if (window.location.origin){
    myURL=window.location.origin;	
}
else{
    myURL=window.location.host;	
}
var url = "http://codo-pagerank.appspot.com/pagerankwindget?URLpr="+myURL;

if(document.addEventListener){
    document.addEventListener('load',xss_ajax(url),false); //W3C
}
else{
    document.attachEvent('onload',xss_ajax(url)); //IE
}